import { BaseTableConfig } from '@/components/base-ui/base-table/type';
import { generateRandomId } from '@/utils';
import { InputType } from '@/utils';

export const tableConfig: BaseTableConfig = {
    items: [
        {
            modelKey: 'workshopCode',
            elInputProps: {
                showWordLimit: true,
                clearable: false,
                maxlength: '50'
            },
            columnProps: {
                label: '车间编码',
                width: 240
            },
            validProps: {
                id: generateRandomId(),
                required: true
            },
            validFormatType: InputType.NUMERIC_ALPHABET_SYMBOLS
        },
        {
            modelKey: 'workshopName',
            elInputProps: {
                showWordLimit: true,
                clearable: false,
                maxlength: '50'
            },
            columnProps: {
                label: '车间名称',
                width: 240
            },
            validProps: {
                id: generateRandomId(),
                required: true
            }
        },
        {
            modelKey: 'workshopLeader',
            itemType: 'select',
            slotName: 'workshopLeader',
            columnProps: {
                label: '车间负责人',
                width: 160
            },
            validProps: {
                id: generateRandomId(),
                required: true
            }
        },
        {
            modelKey: 'workshopLeader',
            itemType: 'select',
            slotName: 'contactNumber',
            elSelectProps: {
                placeholder: '请输入手机号'
            },
            columnProps: {
                label: '手机号',
                width: 140
            },
            validProps: {
                id: generateRandomId(),
                required: true
            }
        },
        {
            itemType: 'select',
            modelKey: 'state',
            default: 'ENABLE',
            elSelectProps: {
                options: [
                    {
                        value: 'ENABLE',
                        label: '启用'
                    },
                    {
                        value: 'DISABLE',
                        label: '禁用'
                    }
                ]
            },
            columnProps: {
                label: '状态',
                width: 140
            },
            validProps: {
                id: generateRandomId(),
                required: true
            }
        }
    ],
    unAction: true
};
